negotiator.tournament
Class Tournament

java.lang.Object
  extended by negotiator.tournament.Tournament
All Implemented Interfaces:
java.io.Serializable

public class Tournament
extends java.lang.Object
implements java.io.Serializable

This class stores all tournament info (protocol, list of profiles, list of agents, etc.) This is then converted into a list of Protocols using getSessions(). These Protocols (which are actually just negotiation sessions) are then run by TournamentRunner, one by one, in TournamentRunner.run(). (Tournament contains the information for only one negotiation if you choose Negotiation Session!). Only ONE ProfileValue is allowed in the variables. Only TWO AgentValues are allowed.

Author:
wouter
See Also:
Serialized Form

Field Summary
 int TournamentNumber
          TournamentNumber is used to give a unique reference to this tournament to the user.
static int VARIABLE_AGENT_A
           
static int VARIABLE_AGENT_B
           
static int VARIABLE_DB_LOCATION
           
static int VARIABLE_DB_PASSWORD
           
static int VARIABLE_DB_SESSIONNAME
           
static int VARIABLE_DB_USER
           
static int VARIABLE_DECOUPLED_A
           
static int VARIABLE_DECOUPLED_B
           
static int VARIABLE_NUMBER_OF_RUNS
           
static int VARIABLE_PROFILE
           
static int VARIABLE_PROTOCOL
           
static int VARIABLE_TOURNAMENT_OPTIONS
           
 
Constructor Summary
Tournament()
           
 
Method Summary
 java.util.ArrayList<AgentVariable> getAgentVars()
           
 java.util.ArrayList<BOAagentInfo> getBOAagentA()
           
 java.util.ArrayList<BOAagentInfo> getBOAagentB()
           
 java.util.ArrayList<AgentVariable> getDecoupledAgentVars()
          Converts the descriptions of the BOA framework agents to actual agents compatible with Genius.
 int getNumberOfSessions()
           
 java.util.HashMap<java.lang.String,java.lang.Integer> getOptions()
           
 java.util.ArrayList<AssignedParameterVariable> getParametersOfAgent(AgentRepItem agent, java.lang.String name)
           
 java.util.ArrayList<ProfileRepItem> getProfiles()
          Get the profiles that are available.
 ProtocolRepItem getProtocol()
           
 int getRounds()
          Returns how many times each session is repeated in a tournament.
 java.util.ArrayList<Protocol> getSessions()
          Get all combinations of agents, domains, etc.
 java.util.ArrayList<TournamentVariable> getVariables()
           
 void resetTournament()
          Throw away all calculated sessions to allow serialization.
 void setBOAagentA(java.util.ArrayList<BOAagentInfo> BOAagentList)
           
 void setBOAagentB(java.util.ArrayList<BOAagentInfo> BOAagentList)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TournamentNumber

public final int TournamentNumber
TournamentNumber is used to give a unique reference to this tournament to the user. So the first tournament the user creates is tournament 1, the second 2, etc. The number is used in the tabs, eg "tour1" as tab name.


VARIABLE_PROTOCOL

public static final int VARIABLE_PROTOCOL
See Also:
Constant Field Values

VARIABLE_PROFILE

public static final int VARIABLE_PROFILE
See Also:
Constant Field Values

VARIABLE_AGENT_A

public static final int VARIABLE_AGENT_A
See Also:
Constant Field Values

VARIABLE_AGENT_B

public static final int VARIABLE_AGENT_B
See Also:
Constant Field Values

VARIABLE_NUMBER_OF_RUNS

public static final int VARIABLE_NUMBER_OF_RUNS
See Also:
Constant Field Values

VARIABLE_TOURNAMENT_OPTIONS

public static final int VARIABLE_TOURNAMENT_OPTIONS
See Also:
Constant Field Values

VARIABLE_DECOUPLED_A

public static final int VARIABLE_DECOUPLED_A
See Also:
Constant Field Values

VARIABLE_DECOUPLED_B

public static final int VARIABLE_DECOUPLED_B
See Also:
Constant Field Values

VARIABLE_DB_LOCATION

public static final int VARIABLE_DB_LOCATION
See Also:
Constant Field Values

VARIABLE_DB_USER

public static final int VARIABLE_DB_USER
See Also:
Constant Field Values

VARIABLE_DB_PASSWORD

public static final int VARIABLE_DB_PASSWORD
See Also:
Constant Field Values

VARIABLE_DB_SESSIONNAME

public static final int VARIABLE_DB_SESSIONNAME
See Also:
Constant Field Values
Constructor Detail

Tournament

public Tournament()
Method Detail

getSessions

public java.util.ArrayList<Protocol> getSessions()
                                          throws java.lang.Exception
Get all combinations of agents, domains, etc. via reflection

Throws:
java.lang.Exception

resetTournament

public void resetTournament()
Throw away all calculated sessions to allow serialization.


getAgentVars

public java.util.ArrayList<AgentVariable> getAgentVars()
Returns:
the available AgentVariables in the tournament.

getNumberOfSessions

public int getNumberOfSessions()
Returns:
the number of sessions the tournament. Default = 1.

getRounds

public int getRounds()
Returns how many times each session is repeated in a tournament.

Returns:
round count

getOptions

public java.util.HashMap<java.lang.String,java.lang.Integer> getOptions()

getProtocol

public ProtocolRepItem getProtocol()
                            throws java.lang.Exception
Throws:
java.lang.Exception

getProfiles

public java.util.ArrayList<ProfileRepItem> getProfiles()
                                                throws java.lang.Exception
Get the profiles that are available. The TournamentVarsUI will always place them in position 0 of the array but that is not mandatory.

Throws:
java.lang.Exception

getParametersOfAgent

public java.util.ArrayList<AssignedParameterVariable> getParametersOfAgent(AgentRepItem agent,
                                                                           java.lang.String name)
Parameters:
agent - the agent you want the parameters of
name - the name of this unique instantiation of the agent. Typically AgentA and AgentB.
Returns:
ArrayList of AssignedParameterVariable of given agent that are selected/set in this tournament.

getVariables

public java.util.ArrayList<TournamentVariable> getVariables()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getDecoupledAgentVars

public java.util.ArrayList<AgentVariable> getDecoupledAgentVars()
Converts the descriptions of the BOA framework agents to actual agents compatible with Genius.

Returns:
list of Genius compatible agents

getBOAagentA

public java.util.ArrayList<BOAagentInfo> getBOAagentA()

getBOAagentB

public java.util.ArrayList<BOAagentInfo> getBOAagentB()

setBOAagentA

public void setBOAagentA(java.util.ArrayList<BOAagentInfo> BOAagentList)

setBOAagentB

public void setBOAagentB(java.util.ArrayList<BOAagentInfo> BOAagentList)